<?php

class CommentArray{
	// fixar så att alla comment-objekt hamnar i arrayen
	private $m_comments = array();
	
	public function __construct(){
		
	}
	// lägger till en kommentars-objekt i arrayen
	public function add(Comment $comment){
		$this->m_comments[] = $comment;
	}
	// hämtar arrayen
	public function get(){
		return $this->m_comments;
	}
	
}

class Comment{
	private $m_name; // string
	private $m_text; // string
	private $m_date; // date
	private $m_id; // integer
	
	// konstruktor
	public function __construct($id, $name, $text, $date){
		$this->m_id = $id;
		$this->m_name = $name;
		$this->m_text = $text;
		$this->m_date = $date;
	}
	// get-metoder på alla medlemsvariabler
	public function getName(){
		return $this->m_name;
	}
	public function getText(){
		return $this->m_text;
	}
	public function getDate(){
		return $this->m_date;
	}
	public function getID(){
		return $this->m_id;
	}
	
}
